﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAO
{
   public class TraCuuDAO
    {
       public static DataTable TraCuuSach(String tracuu)
       {
           DataTable dt= new DataTable();
           List<SqlParameter> parameter= new List<SqlParameter>();
           try
           {
               SqlParameter sp= new SqlParameter("@TraCuu",tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuSach",parameter);

           }
           catch (Exception)
           {                              
           }
           return dt;
       }
       public static DataTable TraCuuDocGia(String tracuu)
       {
           DataTable dt = new DataTable();
           List<SqlParameter> parameter = new List<SqlParameter>();
           try
           {
               SqlParameter sp = new SqlParameter("@TuKhoa", tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuDocGia", parameter);

           }
           catch (Exception)
           {
           }
           return dt;
       }
       public static DataTable TraCuuTacGia(String tracuu)
       {
           DataTable dt = new DataTable();
           List<SqlParameter> parameter = new List<SqlParameter>();
           try
           {
               SqlParameter sp = new SqlParameter("@TuKhoa", tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuTacGia", parameter);

           }
           catch (Exception)
           {
           }
           return dt;
       }
       public static DataTable TraCuuBaoTC(String tracuu)
       {
           DataTable dt = new DataTable();
           List<SqlParameter> parameter = new List<SqlParameter>();
           try
           {
               SqlParameter sp = new SqlParameter("@TuKhoa", tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuBaoTapChi", parameter);

           }
           catch (Exception)
           {
           }
           return dt;
       }
       public static DataTable TraCuuPhieuMuon(String tracuu)
       {
           DataTable dt = new DataTable();
           List<SqlParameter> parameter = new List<SqlParameter>();
           try
           {
               SqlParameter sp = new SqlParameter("@TuKhoa", tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuPhieuMuon", parameter);

           }
           catch (Exception)
           {
           }
           return dt;
       }
       public static DataTable TraCuuPhieuTra(String tracuu)
       {
           DataTable dt = new DataTable();
           List<SqlParameter> parameter = new List<SqlParameter>();
           try
           {
               SqlParameter sp = new SqlParameter("@TuKhoa", tracuu);
               parameter.Add(sp);
               dt = SqlDataAccessHelper.ExecuteQuery("TraCuuPhieuTra", parameter);

           }
           catch (Exception)
           {
           }
           return dt;
       }
    }
}
